package org.bluedream.core.module.dao.goods;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.bluedream.core.module.entity.goods.Goods;
import org.bluedream.core.module.entity.goods.Product;

import java.util.List;

/**
 * @ClassName ProductDao
 * @Description TODO
 * @Author Administrator
 * @Data 8:57
 * @Version
 */
public interface ProductDao extends BaseMapper<Product> {

    @Select("select substr(a.barcode , length(a.barcode) - 3 , 3) as tmpBarcode from product a, goods goods " +
            "${ew.customSqlSegment} and a.code = goods.code and a.org_code = goods.org_code and a.id = goods.id")
    List<String> selectBarcode( @Param("ew") Wrapper<Goods> queryWrapper);
}
